﻿<view:ModuleView x:Class="UCOLOR.View.DirListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:helpers="clr-namespace:UCOLOR.Helpers"
    xmlns:local="clr-namespace:UCOLOR.App.Extend"
    xmlns:view="clr-namespace:UCOLOR.View"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="1118" FontWeight="Bold" Focusable="True" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars">
    <view:ModuleView.Resources>
        <local:ScalablePaddingConverter x:Key="ScalablePaddingConverter"/>
        <helpers:StringFormatConverter x:Key="StringFormatConverter" />
        <helpers:ImageSourceConverter x:Key="ImageSourceConverter" />
        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="3" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="ButtonNormalBackgroundFill" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFFFFF" Offset="0"/>
            <GradientStop Color="#FFF0F0EA" Offset="0.9"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ButtonBorder" Color="#FF003C74"/>
        <Style x:Key="DefaultStyle" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="LayoutRoot" RenderTransformOrigin="0.5,0.5">
                            <Rectangle x:Name="Background"
                                Fill="{TemplateBinding Background}" />
                            <Rectangle x:Name="BackgroundGradient"
                               
                                StrokeThickness="0" Margin="0" RadiusX="15" RadiusY="15">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1,1">

                                        <GradientStop Color="Transparent" Offset="0.7" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                              Grid.RowSpan="2" 
                                              RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="VerticalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="12" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style x:Key="HorizontalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style x:Key="FlatTile" TargetType="dxlc:Tile">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </view:ModuleView.Resources>
     <Grid Name="Center" Background="#FFFFFFFF" Height="auto" >
       
            <dxlc:TileLayoutControl x:Name="DirList"  Margin="10,10,10,10" AllowItemMoving="True" Orientation="Vertical" Padding="0" BreakFlowToFit="True" ItemsSource="{Binding data}" Height="570">
                        <dxlc:TileLayoutControl.ItemTemplate>
                        <DataTemplate>
                            <dxlc:Tile Width="320" Height="250" Header="{Binding}" Content="{Binding}" VerticalHeaderAlignment="Stretch" helpers:ZoomHelper.SupressZoomFactor="300"
                                helpers:TileSelectHelper.ComparisonPropertyPath="ID"
                                Padding="0" Uid="{Binding Category}" Click="Tile_Click">
                                <dxlc:Tile.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <helpers:VisualStateControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <Grid>
                                                    <Border Background="#DDDEEE" Opacity="0" />
                                                    <Grid>
                                                    <Border Background="#DDDEEE" VerticalAlignment="Top" HorizontalAlignment="Left">
                                                            <StackPanel Margin="6,2,6,3">
                                                            <TextBlock Text="{Binding description}" FontFamily="Segoe UI Light" FontSize="30" />
                                                            </StackPanel>
                                                        </Border>
                                                    </Grid>
                                                </Grid>
                                            </helpers:VisualStateControl>
                                            <Grid IsHitTestVisible="False" Visibility="{Binding Path=(helpers:TileSelectHelper.IsSelected), RelativeSource={RelativeSource AncestorType=dxlc:Tile}}">
                                            <Border BorderBrush="#DDDEEE" Background="Transparent" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                                            </Grid>
                                        </Grid>
                                    </DataTemplate>
                                </dxlc:Tile.HeaderTemplate>
                                <dxlc:Tile.ContentTemplate>
                                    <DataTemplate>
                                <Image Stretch="Fill"  Source="{Binding PhotoSource}" />
                                    </DataTemplate>
                                </dxlc:Tile.ContentTemplate>
                            </dxlc:Tile>
                        </DataTemplate>
                    </dxlc:TileLayoutControl.ItemTemplate>
                </dxlc:TileLayoutControl>
        </Grid>
</view:ModuleView>
